CREATE TABLE sys_BillNumber
(
	ID INT NOT NULL,
	IND INT NOT NULL,
	NumType INT NOT NULL,
	FORMAT VARCHAR(50) NULL,
	PRIMARY KEY(ID,IND)
)
CREATE TABLE sys_BillNumberCurNo
(
	ID INT NOT NULL,
	[Key] INT NOT NULL,
	CurNo INT NOT NULL,
	PRIMARY KEY(ID,[Key])
)
GO
INSERT INTO sys_BillNumber VALUES(41,1,1,'DB')
INSERT INTO sys_BillNumber VALUES(41,2,2,'yyMMdd')
INSERT INTO sys_BillNumber VALUES(41,3,7,null)

INSERT INTO sys_BillNumber VALUES(1001,1,1,'BH')
INSERT INTO sys_BillNumber VALUES(1001,2,2,'yyMMdd')
INSERT INTO sys_BillNumber VALUES(1001,3,7,null)

INSERT INTO sys_BillNumber VALUES(1,1,1,'WG')
INSERT INTO sys_BillNumber VALUES(1,2,2,'yyMMdd')
INSERT INTO sys_BillNumber VALUES(1,3,7,null)

INSERT INTO sys_BillNumber VALUES(2,1,1,'CP')
INSERT INTO sys_BillNumber VALUES(2,2,2,'yyMMdd')
INSERT INTO sys_BillNumber VALUES(2,3,7,null)

